<div id="EditContactDlg"  style="display:none;" title="Edit Contact">
	<?php
	$form = $this->beginWidget('PsActiveForm', array(
		'id' => 'edit-contact-form',
		'action' => array('/contact/ajaxUpdateContact/'.$contact->id),
		'enableAjaxValidation' => false,
		'enableClientValidation' => true,
		'clientOptions' => array(
			'inputContainer' => 'tr',
			'validationDelay' => 0,
			'validateOnSubmit' => true,
			)));
	?>
	<table class="form-table">
		<tr>
			<th scope="row" width="120">
				<?php echo $form->labelEx($contact, 'name'); ?>
			</th>
			<td>
				<div>
					<?php echo $form->textField($contact, 'name', array('size' => 45, 'readonly' => 'readonly')); ?>
					<?php echo $form->error($contact, 'name'); ?>
					<?php echo $form->hiddenField($contact, 'id'); ?>
				</div>
			</td>
		</tr>
		<tr>
			<th scope="row" width="120">
				<?php echo $form->labelEx($contact, 'company'); ?>
			</th>
			<td>
				<div>
					<?php echo $form->textField($contact, 'company', array('size' => 45, 'readonly' => 'readonly')); ?>
					<?php echo $form->error($contact, 'company'); ?>
				</div>
			</td>
		</tr>
		<tr>
			<th scope="row" width="120">
				<?php echo $form->labelEx($contact, 'job_title'); ?>
			</th>
			<td>
				<div>
					<?php echo $form->textField($contact, 'job_title', array('size' => 45, 'readonly' => 'readonly')); ?>
					<?php echo $form->error($contact, 'job_title'); ?>
				</div>
			</td>
		</tr>
		<tr><td></td></tr>
<!--		<tr>
			<th scope="row" width="90">
		<?php //echo $form->labelEx($contact, 'nric'); ?>
			</th>
			<td>
				<div class="form-table-block">
		<?php //echo $form->textField($contact, 'nric', array('size' => 24)); ?>
		<?php //echo $form->error($contact, 'nric'); ?>
				</div>
				<div class="form-table-block">
		<?php //echo $form->dropDownList($contact, 'nric_type', array('nric' => 'NRIC', 'fin' => 'FIN', 'passport' => 'Passport'), array('prompt' => '')); ?>
		<?php //echo $form->error($contact, 'nric_type'); ?>
				</div>
			</td>
		</tr>
		<tr>
			<th scope="row" width="90">
		<?php //echo $form->labelEx($contact, 'birthday'); ?>
			</th>
			<td>
				<div class="form-table-block">
		<?php
//					$form->widget('PsJuiDatePicker', array(
//						'model' => $contact,
//						'attribute' => 'birthday',
//						'options' => array(
//							'showButtonPanel' => false,
//							'changeYear' => true,
//							'yearRange' => 'c-100:c+0',
//							'dateFormat' => 'dd-mm-yy'
//						),
//					));
		?>
		<?php //echo $form->error($contact, 'birthday'); ?>
				</div>
			</td>
		</tr>-->
		<tbody class="contact-address">
			<tr>
				<th scope="row" width="120">Address</th>
				<td></td>
			</tr>
			<tr>
				<th scope="row" width="135">
					<?php echo $form->labelEx($contact, 'postcode'); ?>
				</th>
				<td>
					<div class="form-table-block">
						<?php echo $form->textField($contact, 'postcode', array('size' => 15,)); ?>
						<?php echo $form->error($contact, 'postcode'); ?>
					</div>
					<div class="form-table-block">
						<button id="btnSearchPostalcodeContact" type="button" class="btnSearchPostalcodeContact link-button with-icon round_all">
							<img src="/images/icons/fugue/magnifier.png" />
							Search
						</button>
					</div>
				</td>
			</tr>
			<tr>
				<th scope="row" width="135">
					<?php echo $form->labelEx($contact, 'building'); ?>
				</th>
				<td>
					<div class="form-table-block">
						<?php echo $form->textField($contact, 'building', array('size' => 40,)); ?>
						<?php echo $form->error($contact, 'building'); ?>
					</div>
				</td>
			</tr>
			<tr>
				<th scope="row" width="135">
					<?php echo $form->labelEx($contact, 'address_1', array('label' => 'Address')); ?>
				</th>
				<td>
					<div class="form-table-block">
						<?php echo $form->labelEx($contact, 'block'); ?>
						<?php echo $form->textField($contact, 'block', array('size' => 8,)); ?>
						<?php echo $form->error($contact, 'block'); ?>
					</div>
					<div class="form-table-block">
						<?php echo $form->labelEx($contact, 'street'); ?>
						<?php echo $form->textField($contact, 'street', array('size' => 50,)); ?>
						<?php echo $form->error($contact, 'street'); ?>
					</div>
					<div class="form-table-block">
						<?php echo $form->labelEx($contact, 'floor'); ?>
						<?php echo $form->textField($contact, 'floor', array('size' => 4,)); ?>
						<?php echo $form->error($contact, 'floor'); ?>
					</div>
					<div class="form-table-block">
						<?php echo $form->labelEx($contact, 'unit'); ?>
						<?php echo $form->textField($contact, 'unit', array('size' => 6,)); ?>
						<?php echo $form->error($contact, 'unit'); ?>
					</div>
				</td>
			</tr>
			<tr>
				<th scope="row" width="135">
					<?php echo $form->labelEx($contact, 'country_code'); ?>
				</th>
				<td>
					<div class="form-table-block">
						<?php
						echo $form->dropDownList($contact, 'country_code', Country::getCountryListDataByCountryCode(), array(
							'prompt' => 'Select Country',
							'options' => array('separator1' => array('disabled' => true), 'separator2' => array('disabled' => true)),
							'class' => ($i == 0 ? 'ps-autofilled' : '')
						));
						?>
						<?php echo $form->error($contact, 'country_code'); ?>
					</div>
				</td>
			</tr>
			<tr>
				<th scope="row" width="120"></th>
				<td></td>
			</tr>
			<tr>
				<th scope="row" width="120"></th>
				<td></td>
			</tr>
		</tbody>
	</table>
	<?php $this->endWidget(); ?>
</div>